package es.mgil.linternas;

import es.mgil.linternas.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;

public class LinternaBlanca extends Activity {
	private RelativeLayout fondo;
	private int colorNegro = 0xff000000;
	private int colorBlanco = 0xffffffff;
	private boolean encendida = false;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.linterna_blanca);

		fondo = (RelativeLayout) findViewById(R.id.fondoBlanco);
		fondo.setBackgroundColor(colorNegro);
	}

	public void encender(View view) {
		if (encendida) {
			// apagar
			encendida = false;
			fondo.setBackgroundColor(colorNegro);
		} else {
			// encender
			encendida = true;
			fondo.setBackgroundColor(colorBlanco);
		}
	}
}
